<include file="Public/header"/>
<style>
    .report-file {
        display: block;
        position: relative;
        width: 120px;
        height: 34px;
        overflow: hidden;
        border: 1px solid #428bca;
        background: none repeat scroll 0 0 #428bca;
        color: #fff;
        cursor: pointer;
        text-align: center;
        float: left;
        margin-right: 5px;
        border-radius: 3px;
        margin-top: 20px;
    }

    .report-file span {
        cursor: pointer;
        display: block;
        line-height: 34px;
    }

    .file-prew {
        position: absolute;
        top: 0;
        left: 0;
        width: 120px;
        height: 34px;
        opacity: 0;
        filter: alpha(opacity=0);
        cursor: pointer;
    }
</style>
<div class="wrapper m-t">

    <div class="panel panel-info">
        <div class="panel-heading no-padding">
            <div class="panel-options">
                <ul class="nav nav-tabs">
                    <li><a href="{:U('OrderSet/parameterlist')}">订单参数</a></li>
                    <li><a href="{:U('OrderSet/craftSet')}">工艺信息设置</a></li>
                    <li class="active"><a href="{:U('OrderSet/linetype')}">线条要求设置</a></li>
                    <li><a href="{:U('OrderSet/colorset')}">颜色管理</a></li>
                    <li><a href="{:U('OrderSet/goalpost')}">门型设置</a></li>
                </ul>
            </div>
        </div>
        <div class="panel-body">
            <div class="ibox-content">
                <h3 class="text-center">线条长度设置</h3><br>

                <form class="form-horizontal from-length" action="{:U('')}" method="post">

                    <div id="firstitem">

                        <volist name="lengthlist" key="k" id="vo">

                    <div class="form-group" >
                        <label class="col-sm-3 control-label">线条长度：</label>
                        <div class="col-sm-3">
                            <input type="text" value="{$vo.lenth_value}" name="lenth_value[]" class="form-control"/>
                            <input type="hidden" value="{$vo.id}" name="id[]"/>
                        </div>
                        <div class="col-sm-1">
                            <if condition="$k eq 1">
                                  <span class="btn btn-primary btn-circle btn-outline" id="additem">
                                      <i class="fa fa-plus"></i>
                                  </span>
                                      <else/>

                           <a href="{:U('OrderSet/lengthdel?id='.$vo[id])}" class="ajax-get confirms btn btn-danger btn-circle btn-outline" >
                                      <i class="fa fa-times"></i>
                                  </a>
                            </if>

                        </div>
                    </div>
                        </volist>

                    </div>

                    <div class="form-group">
                        <label class="col-lg-3 control-label"></label>
                        <div class="col-lg-8">
                            <input type="submit" target-form="from-length" class="ajax-post btn btn-primary m-r col-lg-2" value="确定"/>
                            <input type="button" class="btn btn-info col-lg-2" value="返回"/>
                        </div>
                    </div>

                </form>


            </div>
        </div>
    </div>
</div>
<include file="Public/footer"/>
<script>
    $('#additem').click(function(){
        $('#firstitem').append('<div class="form-group">' +
                '<label class="col-sm-3 control-label">线条长度：</label>' +
                '<div class="col-sm-3">' +
                '<input name="lenth_value[]" type="text" class="form-control"/></div>' +
                '<div class="col-sm-1">' +
                '<span class="btn btn-danger btn-circle btn-outline xdel">' +
                '<i class="fa fa-times"></i>' +
                '</span></div></div>')
    });

    $('body').on('click','.xdel',function(){
        $(this).parents('.form-group').remove();
    })

</script>


